
import _EventEmitter from 'events';


class EventEmitter extends _EventEmitter {
    constructor(args) {
        super(args);
        this._allowEventKeys = args.allowEventKeys;
    }
    emit(eventType, ...args) {
        if (!this._allowEventKeys || this._allowEventKeys.indexOf(eventType) > -1) {
            super.emit(eventType, ...args);
        } else {
            console.warn('无法识别的事件类型');
        }
    }
}
// new EventEmitter()
export default EventEmitter;